Search Results

Search: Posts Made By: meetmedude
2,480
Posted By meetmedude
Thanks a lot pamu and bipinajith.
Thanks a lot pamu and bipinajith.
2,480
Posted By meetmedude
Split XML file
Hi Experts,

Can you please help me to split following XML file based on new Order ? Actual file is very big. I have taken few lines of it.



<?xml version="1.0" encoding="utf-8"...
2,889
Posted By meetmedude
Hi, Input file is following line. ...
Hi, Input file is following line.


STG,12345,000,999,'PQR, 2345,000,999,'XYZ,7890,000,999,


and required output is


STG,12345,000,999,'
PQR, 2345,000,999,'
XYZ,7890,000,999,

...
2,889
Posted By meetmedude
Thanks alot. SED is working fine for both...
Thanks alot. SED is working fine for both formatted and unformatted files.

One question, [A-Za-z0-9] means all capital and small chars also numbers.
I am working on UK file which might have some...
2,889
Posted By meetmedude
I am using Linux OS, following is the output of...
I am using Linux OS, following is the output of od -c command.

0000000 S T G , 1 2 3 4 5 , 0 0 0 , 9 9
0000020 9 , ' P Q R , 2 3 4 5 ,...
2,889
Posted By meetmedude
Same issue again :). For unformatted file its...
Same issue again :). For unformatted file its working perfectly fine.
but if file is already formatted, its adding new lines in between.

Can we do following:
Remove all new line character...
2,889
Posted By meetmedude
Same issue, its working on non-formated file but...
Same issue, its working on non-formated file but if file is already formatted, It adds new line after ' char


STG,12345,000,999,'

PQR, 2345,000,999,'

XYZ,7890,000,999,
2,889
Posted By meetmedude
Thanks for your help, this works fine if file is...
Thanks for your help, this works fine if file is not in proper format. but if it is already in required format , then it again adds new blank line after eachline. like following.

...
2,889
Posted By meetmedude
Add new line after ' char
Hello experts,

I need to convert one file into readable format.

Input file is like following line.

STG,12345,000,999,' PQR, 2345,000,999,' XYZ,7890,000,999,

Output should be following...
8,005
Posted By meetmedude
Hi, Thanks all for your help. I am using...
Hi,

Thanks all for your help. I am using following command to split the file.
I just wanted to know if we can get filecount appended to the filename.

/usr/xpg4/bin/awk -F";" '{ print >>...
3,268
Posted By meetmedude
Thanks panyam. This is working. Thanks alot.
Thanks panyam. This is working. Thanks alot.
3,268
Posted By meetmedude
For every "410" at position 43 to 45, I need to...
For every "410" at position 43 to 45, I need to create new file.


for sample data shown in above post, I need 2 output files


First file will have following lines
...
3,268
Posted By meetmedude
Split positional flat file.
Hi,

I need to split positional flat file, based on value at position 43-45.( in red "410")
Example:
12345678907886421689 200920184820410200920020092002007
12345678907886421689 ...
2,069
Posted By meetmedude
I am on Solaris and tried /usr/xpg4/bin/awk but...
I am on Solaris and tried /usr/xpg4/bin/awk but it generated only one output file.

any idea how we can use string variables... its taking only numbers.
2,069
Posted By meetmedude
Actually file is really big so posting few Lines...
Actually file is really big so posting few Lines ....
2,069
Posted By meetmedude
Hi Franklin52, Your code generates only...
Hi Franklin52,
Your code generates only one file whereas it should generate 4 files.

Hi lathavim,
I tried with var=`date +"%m%d%y%H%M%S"` in your code and the filename generated was...
2,069
Posted By meetmedude
nopes... not working. :mad:
nopes... not working. :mad:
2,069
Posted By meetmedude
Problem with AWK.
Hi,

I am splitting file on each HEADER. I am using following command.

awk '/^HEADER/{close("file"f);f++}{print $0 > "FILE_"f}' $Filename

I want to use a variable while generating output...
8,005
Posted By meetmedude
Hi, nawk -F";" '{ print >> "file_"$1;...
Hi,

nawk -F";" '{ print >> "file_"$1; close("file_"$1)}' EPA

even this doesnt work.

Error:
nawk: syntax error at source line 1
context is
{ print >> >>> "file_"$1 <<< ;...
8,005
Posted By meetmedude
Hi Franklin, yes I tried that and again same...
Hi Franklin, yes I tried that and again same error :(.

nawk: syntax error at source line 1
context is
{ print >> >>> "file"_ <<< $1; close("file"_$1)}
nawk: illegal statement at...
8,005
Posted By meetmedude
I agree... but I tried this as well but getting...
I agree... but I tried this as well but getting same error. its not taking print >> "file_"$1 command. Any other way to create file ?

nawk -FS=";" '{ print >> "file_"$1}' Testfile.txt
8,005
Posted By meetmedude
even if you give -F it gives same error...
even if you give -F it gives same error...
8,005
Posted By meetmedude
Hi, I am trying nawk but its giving errors .......
Hi,
I am trying nawk but its giving errors ....

nawk -FS=";" '{ print >> file_$1}' Testfile.txt

Error:
nawk: syntax error at source line 1
context is
{ print >> >>> file_$1 <<<...
8,005
Posted By meetmedude
Hi, I tried this and getting same error... ...
Hi,

I tried this and getting same error...

awk: too many output files 10
record number 222
8,005
Posted By meetmedude
Hi This code works for small files. but for...
Hi
This code works for small files.
but for large files, its giving error...

awk: too many output files 10
record number 222

its creating max 10 files.... any option that we need to change...
Showing results 1 to 25 of 28

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