Hello, Have several shell scripts, that issue sed and awk commands that have worked will for years on SCO Unix. We are moving our application to a new Redhat...
... have ... to ... Hello Again, Found that shell scripts and awk programs work fine. It was just the transfer process that added something to each end of...
I have a set of files that need to have a number assigned to $3 for each record, but if the record has the same value in $2, the value in $3 must stay the same...
In order to achieve what you give in your example, I would suggest this: BEGIN {FS="|"; OFS="|"; last="";} { if ($2 != last) { last = $2 line++; } $3 =line; ...
pl. help. I have large data files that separated by numeric file extensions. I need t process them in order and compile the necessary info. What is the best...
I have used gawk for similar applications. Since it processes files sequentially, it can handle very large files. The only significant limits are the speed...
... Thanks Albert! Your solution works great. I did have to change it to fit my actual file format - here are a few lines (bear with me - I'm showing the REST...
Okay, so it sounds like you've got two different counters which vary independently, which are embedded in the file names. So, one way to accomplish that would...
From what you've said below, it sounds like you've handled things more or less the way I would have done it. Perhaps there is a more elegant way, but one of...
... The reason I was trying to do it in one script, was for speed - I'm processing about 1 million records each time I run it, and doing quite a few other...
... few ... I'm afraid I don't know that. You might have to do some testing to find out. I was speaking before from the perspective of optimizing development...
With help of someone, for my immediate need, I was able to do the following and was able to process the files. #! /bin/bash for ( j = 1; j < 125; j++ ); do ...
Greetings, I have about 1.5 million records that need to be updated, based on the value in the 1st field (pipe delimited). Loading the records into a database...
Hi gawk gurus, I have an input file that is only one great line, with no field separator. The fields have fixed width. (files from mainframe). for example, an...
... A combination of sed and awk can make this work fairly easily (I'm working on a bash shell, so you may need to tweak this if you use Windows: $ sed...
I noticed the set of sed & awk commands got broken into 1 too many lines. All of this belongs on one line: sed 's/\(.\{14\}\)/\1|/g;s/|/|\n/g' source_file|sed ...
Thanks Don thats a solution! But think about large files (around 3 GB). Thats would be resource intensive, and I would spent disk space, since the original...
Ronzanibr, Both awk and sed have you direct your changes to a new file (though you can perform some tricks to overwrite the source file), so the disk space may...
Hi, I am assuming here that you have the values of the 18,500 records in a text file with this format: 7217878112 |100271|600 -|LRG| so $1 is the key and $2...
I do have the 18500 records in a file, but I don't understand what exact syntax I need to use. Here is what I've got, but it isn't working: array values are in...
put the following script in test.awk BEGIN { keyfile = ARGV[1]; delete ARGV[1]; # print "loading key file " keyfile; while (getline < keyfile) { keyvalue =...
Ambo, Thank you, that works! I did change the last part to 'print $0 upd_key[$1]' since I wanted all of the fields from the sls_test3 file, plus the values...
Hi Don, Sorry for the delay, been very busy lately. OK, to understand this just look at the data we are loading into the upd_key, the "upd_key" file contains ...
... For my data, I can't count on there being a space anywhere - the data in 'upd_key' file is 4 fields, pipe delimited. Also, the 'keyvalue' isn't necessarily...
Hi guys, my situacion is this im trying to do a bash script and when i try this $ grep adyac 2510.log|gawk '{FS=","};{print $1,$2,$3}' to this data ...
Question: Who is the moderator of this list and has control over it? Is there anything that can be done to prevent SPAM postings such as the ones we've been...