Search Results

Search: Posts Made By: santosh2k2
1,091
Posted By santosh2k2
I am new to awk.. tried changing the commands to...
I am new to awk.. tried changing the commands to do required but am getting error. the logic on this on is different in a way that the separator appears at end. dont know if different command for that
1,091
Posted By santosh2k2
File splitter
I have below script which does splitting based on a different criteria. can it be amended to produce required result

SrcFileName=XML_DUMP
awk '/<\?xml version="1\.0" encoding="utf-8"\?>/{n++} ...
2,685
Posted By santosh2k2
code ran successfully with writing any new file.....
code ran successfully with writing any new file.. so basically no output file is generated.

---------- Post updated at 11:07 AM ---------- Previous update was at 10:37 AM ----------

earlier...
2,685
Posted By santosh2k2
It will be difficult for me to justify business...
It will be difficult for me to justify business but even minimizing word length, Its giving same error for large source file. its running fine for small file.
2,685
Posted By santosh2k2
@pamu.. word assignment is working fine...awk ...
@pamu.. word assignment is working fine...awk command s giving error as

awk: 0602-576 A print or getline function must have a file name.
The input line number is 1. The file is a.txt.
The...
2,685
Posted By santosh2k2
Thanks @pamu and @elixir I am happy with...
Thanks @pamu and @elixir

I am happy with below code except two things.
1> Need a variable in awk that can be assigned so shell parameter
2> was not able to assign <?xml version="1.0"...
2,685
Posted By santosh2k2
Source xml file splitter
I have a source file that contains multiple XML files concatenated in it. The separator string between files is <?xml version="1.0" encoding="utf-8"?>. I wanted to split files in multiple files with...
7,748
Posted By santosh2k2
Thanks @pamu .. new code works and able to solve...
Thanks @pamu .. new code works and able to solve issue#2 in my earlier post. can you pls have a look at issue#1 in earlier post pls
7,748
Posted By santosh2k2
Thanks @pamu . its working now. need some more...
Thanks @pamu . its working now. need some more refinements that was their earlier but i am unable to put them in new code

1> if Source file = A.txt. I will receive $1 as A and target file names...
7,748
Posted By santosh2k2
@pamu.. i got below error awk: 0602-533...
@pamu.. i got below error


awk: 0602-533 Cannot find or open file {a++;if($0 ~ /^101/){if(s){
if(a>=CN){a=0;x++;fn=File_name""x;print s > fn;s=$0}else{print s > fn;s=$0}}...
7,748
Posted By santosh2k2
Thanks @pamu...The code works fine as it is. ...
Thanks @pamu...The code works fine as it is.

I am trying to assin variables and still cant get it right . is it possible for you to help please.


Can you assign a variable to Count and...
7,748
Posted By santosh2k2
@pamu.. still not giving correct results in some...
@pamu.. still not giving correct results in some scenarios. I will rewrite the requirements again. as i am now told that its ok to include next set of 104 data even if record count goes beyoond 20.
...
7,748
Posted By santosh2k2
@pamu .., was not able to get right results with...
@pamu .., was not able to get right results with mentioned code.. any other ideas?
7,748
Posted By santosh2k2
The output files required in my example is as...
The output files required in my example is as below. The requirement is
- Records in each file should not be more than 20
- each file should start with 101 record. This ensures that all associated...
7,748
Posted By santosh2k2
My requirement is extended where the file shud...
My requirement is extended where the file shud always start with 101 type record. The record count should be less that 10. for any section, 104 type records will not go more than 7

So below...
7,748
Posted By santosh2k2
Thanks elixir.. hint worked. below is my working...
Thanks elixir.. hint worked. below is my working command.
awk 'NR%"'"10"'"==1{x="'"${SrcFileName}_"'" sprintf("%03d",++i) ".txt"}{print > x}' $SrcFileName.txt

@pamu: Hardcoded 00 will add extra...
7,748
Posted By santosh2k2
File Splitter output filename
Issue: I am able to split source file in multiple files of 10 rows each but unable to get the required outputfile name. please advise.

Details:
input = A.txt having 44 rows

required output =...
7,922
Posted By santosh2k2
read .csv file
Need UNIX script read below .csv file and print the line only records where type = TRN.

Srno,Type,InputFileName,NewColumnData
1,TRN,File1.dat,11
2,TRN,File2.dat,12
3,TRN,File3.dat,13...
Showing results 1 to 18 of 18

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