10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi Forum.
I have the following script that splits a large fixed-width file into smaller multiple fixed-width files based on input segment type.
The main command in the script is:
awk -v search_col_pos=$search_col_pos -v search_str_len=$search_str_len -v segment_type="$segment_type"... (8 Replies)
Discussion started by: pchang
8 Replies
2. Shell Programming and Scripting
All,
I used to use following command to replace specific location in a fixed width file.
Recently looks like my command stopped working as intended. We are on AIX unix.
awk 'function repl(s,f,t,v)
{ return substr(s,1,f-1) sprintf("%-*s", t-f+1, v) substr(s,t+1) }
NR<=10 {... (3 Replies)
Discussion started by: pinnacle
3 Replies
3. Shell Programming and Scripting
hi,
i have a fixed width file with multiple columns and need to print data using awk command.
i use: awk -F "|" '($5 == BH) {print $1,$2,$3}' <non_AIM target>.txt for a delimiter file.
but now i have a fixed width file like below:
7518 8269511BH 20141224951050N8262
11148 8269511BH... (5 Replies)
Discussion started by: kcdg859
5 Replies
4. Shell Programming and Scripting
I have a file with different record length. The file as to be converted into fixed length by appending spaces at the end of record. The length should be calculated based on the record with maximum length in the file.
If the length is less than the max length, the spaces should be appended... (4 Replies)
Discussion started by: Amrutha24
4 Replies
5. Shell Programming and Scripting
I have to create a single file from three files, Please see below for samples:
day.txt
20090101
20090102
item.txt
123456789101
12345678910209
1234567891
str.txt
1
12
123
output.txt
20090101123456789101 1 0
2009010112345678910209 12 ... (2 Replies)
Discussion started by: tamahomekarasu
2 Replies
6. Shell Programming and Scripting
I was wondering someone might be able to push me in the right direction, I am writing a script to modify fixed-width spool files, As you can see below the original spool file broke a single line into two for printability sake.
I have had been able do the joins using sed, the thing I am... (10 Replies)
Discussion started by: Cho Nagurai
10 Replies
7. Shell Programming and Scripting
I know this has been asked before but I just can't parse the syntax as explained. I have a set of files that has user information spread out over two lines that I wish to merge into one:
User1NameLast User1NameFirst User1Address
E-Mail:User1email
User2NameLast User2NameFirst User2Address... (11 Replies)
Discussion started by: walkerwheeler
11 Replies
8. Shell Programming and Scripting
Col1 Col2 Col3 Col4
12 Completed 08 0830
12 In Progress 09 0829
11 For F U 07 0828
Considering the file above, how could i replace the third column the most efficient way? The actual file size is almost 1G. I am... (10 Replies)
Discussion started by: tamahomekarasu
10 Replies
9. UNIX for Dummies Questions & Answers
Have another question that has been eluding me all day.
I have data file I'm trying to reformat so that each line is appended with an ID code, but the ID code needs to update as it searches through the file.
I.e.
----Begin Original Datafile-----
Condition = XXX
Header Line 1
Header... (1 Reply)
Discussion started by: selkirk
1 Replies
10. UNIX for Dummies Questions & Answers
I am using the following command at the Unix prompt to make my 'infile' into a fixed width file of 100 characters.
awk '{printf "%-100s\n",$0}' infile > outfile
However, there are some records with a special character "©"
These records are using 3 characters in place of one and my record... (2 Replies)
Discussion started by: alok.benjwal
2 Replies