10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I use conditional operators alot in AWK to print rows from large text files based on values in a certain column. For example:
awk -F '\t' '{ if ($1 == "A" || $1 == "C" ) print $0}' OFS="\t" file1.txt > file2.txt
In this case every row is printed from file1 to file2 for which the column 1... (5 Replies)
Discussion started by: Geneanalyst
5 Replies
2. UNIX for Beginners Questions & Answers
Greetings,
I need help in splitting the files in an efficient way while accommodating the below requirements . I am on AIX.
Split condition
Split the file based on the record type and the position of the data pattern that appears on the on the record type.
Both record type and and the... (9 Replies)
Discussion started by: techedipro
9 Replies
3. Shell Programming and Scripting
I have a file, which has '|' as separator; I need to read each line from that file and produce output to another file. While reading, I have certain condition on few specific columns (like column3 ='good'); only those lines will be processed. (3 Replies)
Discussion started by: mady135
3 Replies
4. Shell Programming and Scripting
Requirement: Need to split a source file say a1.txt which can be of size upto 150 MB into 25 target files each with a max size of 25 MB along with the header line in each target file.
NOTE: Few target files can be empty also ,but 25 files must be generated for 1 source file( I can expect upto... (4 Replies)
Discussion started by: mad_man12
4 Replies
5. Shell Programming and Scripting
Hi all,
I'm pretty new to Shell scripting and I need some help to split a source text file into multiple files. The source has a row with pattern where the file needs to be split, and the pattern row also contains the file name of the destination for that specific piece. Here is an example:
... (2 Replies)
Discussion started by: cul8er
2 Replies
6. Shell Programming and Scripting
Hi,
I have a file which has xml data but all in single line
Ex -
<?xml version="1.0"?><User><Name>Robert</Name><Location>California</Location><Occupation>Programmer</Occupation></User>
I want to split the data in proper xml format Ex-
<?xml version="1.0"?>
<User>
<Name>Robert</Name>... (6 Replies)
Discussion started by: avishek007
6 Replies
7. Shell Programming and Scripting
Dear all,
I have basic knowledge of Unix script and her I am trying to process variable length and variable format CSV file.
The file length will depend on the numbers of Earnings/Deductions/Direct Deposits.
And
The format will depend on whether it is Earnings/Deductions or Direct Deposits... (2 Replies)
Discussion started by: chechun
2 Replies
8. Shell Programming and Scripting
HI guys,
I have created a script to read 1 column in a csv file and then place it in text file.
However, when i checked out the text file, it is not in a column format...
Example:
CSV file contains
name,age
aa,11
bb,22
cc,33
After using awk to get first column
TXT file... (1 Reply)
Discussion started by: mdap
1 Replies
9. UNIX for Dummies Questions & Answers
I have gone through all the threads in the forum and tested out different things. I am trying to split a 3GB file into multiple files. Some files are even larger than this.
For example:
split -l 3000000 filename.txt
This is very slow and it splits the file with 3 million records in each... (10 Replies)
Discussion started by: madhunk
10 Replies
10. Shell Programming and Scripting
Hi,
Can someone let me know how I can split a record when it contains a vairable length of fields.
Line1
field1,field101,field102,field 103,field104
Line 2
field1,field101,field102,field 103,field104,field201,field202,field 203,field204
Line 3
field1,field101,field102,field... (5 Replies)
Discussion started by: braindrain
5 Replies