12-16-2008
Quote:
Originally Posted by
Cailet
Ok, just kidding. I don't know what happened the first time, but now it is no longer working. Is this maybe a problem with trying to switch from nawk to awk?
maybe...
pls define 'no longer working'. what's happenin'?
do you have 'gawk' available (maybe under /usr/local/bin)?
What OS?
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
How would one go about deleting the first two characters on each line of a file on Unix? I thought about using awk, but cannot seem to find if it can explicitly do this. In this case there might or might not be a field separator. Meaning that the data might look like this.
01999999999... (5 Replies)
Discussion started by: scotbuff
5 Replies
2. UNIX for Dummies Questions & Answers
I have a file that looks like this:
It is a huge file and basically I want to delete everything at the > line except for the number after “C”.
>c1154... (2 Replies)
Discussion started by: kylle345
2 Replies
3. Shell Programming and Scripting
I have two files abc.dat and sant.dat (Big file 60k rows)
for every line's 1,4 of abc.dat need to seach if this is present on 28,4 of sant.dat every line.
if its present the output needs to go to bde.dat
Example:
contents abc.dat
aaaa
bbbb
cccc
dddd
contents sant.dat
this is... (4 Replies)
Discussion started by: ssantoshss
4 Replies
4. Shell Programming and Scripting
Hi
I have a file which contains wrong XML, There are some garbage characters at the end of line that I want to get rid of. Example:
<request type="product" ><attributes><pair><name>q</name><value><!]></value></pair><pair><name>start</name><value>1</value></pair></attributes></request>�J ... (7 Replies)
Discussion started by: dirtyd0ggy
7 Replies
5. Shell Programming and Scripting
Hi,
I have a weird requirement. I am having a file with 12fields in it and the end of the line for each record is "\n" (Just \n and no carriage returns) and the field delimiter is "|". Problem is I can have new line characters in any field in the data and these new line characters can even come... (11 Replies)
Discussion started by: ngkumar
11 Replies
6. Shell Programming and Scripting
Hi,
I am trying to get an output like :
+----------------------------------+ ----------- +
+ some variable substitution + some text +
Is there a way I can specify in printf (in ksh) the particular position I want to print a character, and also repeat a character from... (1 Reply)
Discussion started by: neil.k
1 Replies
7. Shell Programming and Scripting
Hi gurus,
I am trying to figure out how to extract substring from file line (all lines in file), as specified position and specified legth.
Example input (file lines)
dhaskjdsa dsadhkjsa dhsakjdsad hsadkjh
dsahjdksahdsad sahkjd sahdkjsahd sajkdh adhjsak
I want to extract substring on... (5 Replies)
Discussion started by: ProsteJa
5 Replies
8. UNIX for Dummies Questions & Answers
I have several questions about using awk. I'm hoping someone could lend me a hand. (I'm also hoping that my questions make sense.)
I have a file that contains pipe separated data. Each line has similar data but the number of fields and the field position on each line is variable. ... (3 Replies)
Discussion started by: Cheese64
3 Replies
9. Shell Programming and Scripting
I have a file with 100 lines. On 50 th line , from position 5 to rest of the data , I need to change the occurrence of A to B and Occurrence of M to N.
Input file :
Line1
Line2
Line3
--
--
12345ABCDEFM
---
--
Line 100
Output
Line1
Line2 (40 Replies)
Discussion started by: Rajesh_us
40 Replies
10. Shell Programming and Scripting
Hi,
I need to remove line breaks from a file, but only the ones at specific position.
Input file:
this is ok
this line is divided at posit
ion 30. The same as this one,
also position 30
the rest of lines are ok
with different lengths
The longest ones are always s
plitted at same... (15 Replies)
Discussion started by: qranumo
15 Replies