Search Results

Search: Posts Made By: rudoraj
4,028
Posted By rudoraj
its a .txt file. I am familiar to splitting...
its a .txt file.

I am familiar to splitting the file, not sure how to drive the logic with size.

example.
split -l 4000 <file_nm> <file_nm-a>
4,028
Posted By rudoraj
Split the File based on Size
I have a file that is about 7 GB in size. The requirement is I should split the file equally in such a way that the size of the split files is less than 2Gb. If the file is less than 2gb, than...
13,147
Posted By rudoraj
Find the latest file based on the date in the filename
Hi,

We've a list of files that gets created on a weekly basis and it has got a date and time embedded to it. Below are the examples. I want to find out how to get the latest files get the date and...
1,136
Posted By rudoraj
Can we also do it at vi editor as we do global...
Can we also do it at vi editor as we do global replacement? but using my scenario
1,136
Posted By rudoraj
Replace nulls with a value in a file
Hi,

I've a PIPE delimited file with about 5 fields. Sometimes the records in the 4th field is null, so I want to replace it based on values we get it on 2nd field in the same file.

Following is...
9,242
Posted By rudoraj
Replace a field where values are null in a file.
Hi,

I've a pipe delimited file and wanted to replace the 3rd field to 099990 where the values are null. How can I achieve it using awk or sed.

20130516|00000061|02210|111554|03710|2|205069|SM...
4,929
Posted By rudoraj
Get the MAX value out of a column
I've the following data set. I would like to look at the column 3 and only use the rows which has the max value for column 3

Can we use the awk or sed to achieve it.


10 2 10 ...
13,491
Posted By rudoraj
Zip all the files including directories - subdirectories
Hi,

Is is possible to zip a folder and all its contents within the folder ( including sub-directories and files) into a zip file? and can regain the same structure if unzipped?


Thanks
4,436
Posted By rudoraj
if I want to search under /data/raw_files/, there...
if I want to search under /data/raw_files/, there can be multiple directories under raw_files folder. I want to search all the folders recursively and zip those files into a single file. ( there are...
4,436
Posted By rudoraj
Find all the files under a specific directory and zip them into a single file.
Hi,

Is there a way to find all the files from a specific location and then zip them into a single file, even if they are in multiple directories?
1,813
Posted By rudoraj
awk -F"|" '{a[$14]++}END{for(i in a)print a[i] i...
awk -F"|" '{a[$14]++}END{for(i in a)print a[i] i }' file_nm

The above command works fine.
I wanted to extend it to see if all the records from field 14, if they are 0, then extract it to a new...
1,813
Posted By rudoraj
Yes this looks correct, but it is possible to...
Yes this looks correct, but it is possible to have spacing between the counts and the patterns. They seem to be concatenating

---------- Post updated at 10:24 AM ---------- Previous update was at...
1,813
Posted By rudoraj
count the number of occurring patterns in a file.
Hi,

I have a file with a '|' pipe delimeter. I want to find number of counts for a particular pattern in particular field. Is it possible to do it in a single command?

1) want to find total...
5,975
Posted By rudoraj
Moving multiple files based on the pattern
I want to search for a particular file name patterns and move them to a specific folder, is it possible to do it with awk or sed?
2,422
Posted By rudoraj
Replace first field with Rownum in a file
Hi,

I've a file which is "|" delimited. I want to replace the first field with rownum, how can I do it with awk or sed command? There is no header record.

sample file
1195|ABC|DEF|30 LATE...
2,862
Posted By rudoraj
I am running the exact script and gives me the...
I am running the exact script and gives me the ouput as below.

----------------------
po8282.fmt998.fbi.mopac.x.macs.btt.txt
{A/8282/}8283.fmt998.fbi.mopac.x.macs.btt.txt
----------------------...
2,862
Posted By rudoraj
parsing a file name and add a number
Hi,

I have a file po8282.fmt998.fbi.mopac.x.macs.btt.txt . I want to parse the first field which is separated by "." and then find the number and add 1 to it.

here is what I am doing to get the...
16,409
Posted By rudoraj
I am using Linux 2.6.18-128.4.1.el5 #1 SMP...
I am using Linux 2.6.18-128.4.1.el5 #1 SMP GNU/Linux

and bash shell.

/data/output/ has all the folders like

200901, 200902, 200903, 200904 ( which are logically created based on a job)
...
16,409
Posted By rudoraj
Find the latest folder
Hi,

I want to find out the files that are created the recent, how can I do it?

find . -type d

( i dont know what option to use to find the latest, it can be 1 day old or 10 days, but want...
3,570
Posted By rudoraj
Replacing text from multiple files at multiple location
Hi,

I have many files scattered in all different folders. I want to replace the text within all the files using a single command ( awk, sed...) Is it possible?

example

find all the files in...
14,746
Posted By rudoraj
Renaming a file name using awk
I keep on getting different file names onto local directory, which I want to add a date field to it and rename like below. Incoming file names are encrypted (some pgp and some in asc), so when I use...
2,349
Posted By rudoraj
lines 1 and 2 are bad records because of a new...
lines 1 and 2 are bad records because of a new line character after "31 bridge Rd." it is suppose to be a single record with line 2

line 3 is fine.


B0000008650;MACS076775;0087767;NP MEM ...
2,349
Posted By rudoraj
Remove new line characters if found between 1 to 10 columns
Hi,

I have a file with ';' delimeter which has some new line characters. How can I delete the new line characters if they are found between 1 to 10 fields.

Thanks
2,045
Posted By rudoraj
sorry, my delimeter is ";" , not sure what I was...
sorry, my delimeter is ";" , not sure what I was thinking while typing that earlier.

Thanks
2,045
Posted By rudoraj
Delete new line characters from a file
Hi,

I have a file with about 25 colums separated with '~', but few of the lines have extra tabs ('^') and new line characters ('$'). Is there a way I can delete those characters if they are...
Showing results 1 to 25 of 68

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