Search Results

Search: Posts Made By: saratha14
2,406
Posted By saratha14
Yes Corona688. You are correct int truncate. This...
Yes Corona688. You are correct int truncate. This is the reason I get 0 ,1 .. so on.. But I have one more doubt, how does awk know that it has to print the first 34 lines to first set of file and so...
2,406
Posted By saratha14
Yeah. awk '{filename = "sample_file"...
Yeah.
awk '{filename = "sample_file" int((NR-1)/34) ".DAT"; print >> filename}' sample_file.DAT

In that code, so this is how I understand,
first iteration , it reads till 34th line 34-1/34 and...
2,406
Posted By saratha14
Hi RudiC, Got it.so NR is nothing but the no...
Hi RudiC,
Got it.so NR is nothing but the no of lines read by the awk and the for loop printed me 1 till 69.
2,406
Posted By saratha14
Usage of Int with NR in awk
Hello Everyone,

I am new to awk and trying my hand with the diff codes and came across the below code today. It would be great if any of the Guru's help me to understand.

awk '{filename =...
2,464
Posted By saratha14
Hi Rudi/Pravin, Sorry the length was wrong...
Hi Rudi/Pravin,

Sorry the length was wrong in the first file and the I did try with the modified length and it worked fine.. Thank you so much.
2,464
Posted By saratha14
Hi Rudic, I have tried the command but the...
Hi Rudic,
I have tried the command but the length of the file is modified everytime I run the command. For ex

ASDSD ADSD 0000001 X
AAASD ADSD 0000001 X
SDDDD ADSD 0000001 X
...
2,464
Posted By saratha14
Sorry about that RudiC. Those are not decimal...
Sorry about that RudiC. Those are not decimal values in the file and I did not provide no of positions and it should have been 7 digits. The sample value more precisely

ASDSD ADSD 0000000 X...
2,464
Posted By saratha14
Replace and Increment a value in the fixed length file
Hi Everyone,

I need to increment a value in the fixed length file. The file has almost a million rows. Is there any easy way to accomplish this.

Ex
input file
ASDSD ADSD 00000 X
AAASD ADSD...
1,922
Posted By saratha14
:-) Great.. That really helped me a lot. Both the...
:-) Great.. That really helped me a lot. Both the solutions are working fine.. Thank you so much Junior helper and Dodmis..
1,922
Posted By saratha14
Thanks for your quick reply Corona688. But my...
Thanks for your quick reply Corona688. But my file length is almost 250 chars and could not copy it in single line. Is there a way can I parameterize the line to feed into yes command.
1,922
Posted By saratha14
Creating duplicate records from a single line
Hi All,
I would like to create a 1 million duplicate records from a single fixed length row. Is there a simple way to create this quickly in unix. I am using korn shell on the AIX OS.

For ex,
...
Showing results 1 to 11 of 11

 
All times are GMT -4. The time now is 08:18 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy