Summary: Hi, I wrote the following code to read a file line by line #!/bin/ksh for i in `cat a.txt` do echo $i done This is not showing me the file contents li...
Summary: I would like to search a file line by line and remove a delimiter and any chars beyond the delimiter such as a decimal point and any thing beyond the...
Summary: grep -l will print a file name where a match occurs and not the contents of the file. You can use this to generate a list of files that contain a subs...
Summary: my problem is i want to replace a line in a file e.g i want to replace the line DBUID= (some name) with DBUID=$user variable file name is sample.ksh...
Summary: To add to above, if you want to have output assigned to a variable then you can modify the line head -$linenumber $filename|tee temp.txt|tail -1 temp....
Summary: Jim, Thanks for your solution. It's working if i run it from the command line; however when i put it in a file and run as the script and redirect the...
Summary: The awk solution below will ensure that it is joining lines that have the same key value. file1 is processed as the main file, and your example shows ...
Summary: Hi, I need to combine 2 files line-by-line e.g.: file1: a b c file2: x y z results: ax by cz I have been trying to loop with sed, but with no luck. Re...
Summary: Hello, Need urgent help in creating a script to merge multiple files line by line, for ex: file1: 1 2 3 4 5 file2: 1 2 3 file3: 1 2 3 4 output should...
Summary: Hi Jason, I suggest you use Awk. It's the best, when the no of records involved are more. Grep has a limitation as it does scan the whole file once...
Summary: Hi All, How can I find a word and print that line and the next line as well? I know this: awk '{if ($2=="words") {print ab,"\n",$0} {ab=$0}}' file.txt...
Summary: hi, I am trying to write a script to delete few lines from the existing files. The requirement is as follows: 1. I need to grep for a pattern "abc" in...
Summary: I want to extract certain lines of a file between separators such as: ------ aaabbbb ------ aaaaa xxxxxx ------ xxxxx What utility (other than awk or ...
Summary: I am running SCO Unix System V and I am sending a print job (invoice) to a Win98 host. The first page lines up with the pre-printed form. On the next ...
Summary: I was wondering if you could help me with a script to remove ALL the lines in a file that contain the word "BOUNDARY". I have the script like this so...
Summary: How can I remove a line in a file? e.g. File containing the following 307 319 352 If I wanted to remove line 319, what would be the syntax? Any alive ...
Summary: Hi, I am trying to find a way to grep for consecutive lines in a file. I need to see if a specific string appears 24 consecutive times in a log file ...
Summary: i hv written a shell script which exports data to a file and i want to filter out one particular line from that file and manipulate that line further....
Summary: How do i delete first line of a file. The file starts with page break ^L. The first line contains the page break ^L. The file may have multiple pagebr...
Summary: I want to compare lines in a file and if there is duplicate information in a certain field(s) remove it but leave the field seperators. fileA a632713,...