Search Results

Search: Posts Made By: nxp
2,088
Posted By nxp
Averaging all fields while counting repeated records
Hi every one;

I have a 31500-line text file upon which two following tasks are to be performed:

1: Rearranging the file
2: Taking the average of each column (considering number of zeros) and...
1,548
Posted By nxp
Let me elaborate more on this: Let's call...
Let me elaborate more on this:

Let's call the file where I want to grab the number from file1 which may look like


#
#
.
.
0 56
3 34
6 65
9 98
12 23
15 78

So here the...
1,548
Posted By nxp
Inserting a line when its length is variable
Hi Unix experts

I have simple text files in which the number of lines vary from one file to another. They look like the following:

#
#
.
.
34 46
76 72
39 68

I want to...
2,334
Posted By nxp
Thanks for different options! How can i add one...
Thanks for different options! How can i add one space at the beginning of each line while doing the previous task, i.e.

#
#
#
1 2
3 4
5 6
6 7
8 9


The only change is...
2,334
Posted By nxp
Adding characters at the top of all files in directory
Hi Unix experts;

I have 30000 files in a directory and am willing to do the following changes on each of them. The input files look like the following:

1 , 2
3 , 4
5 , 6
7 , 8
9 , ...
3,469
Posted By nxp
Scottn, your code perfectly finds the file but...
Scottn, your code perfectly finds the file but doesn't remove it

Thanks steady for your comments
3,469
Posted By nxp
I tried set A = (ls | xargs -i grep -l...
I tried

set A = (ls | xargs -i grep -l ^0.00 {})
rm -f $A

but it didn't work:(

---------- Post updated at 04:27 PM ---------- Previous update was at 04:24 PM ----------

I am using C...
3,469
Posted By nxp
Dear Steadyonabix; error message shows up...
Dear Steadyonabix;

error message shows up for the second code, Illegal variable name!!
The first code seemingly removes the first field, but i want the file o be deleted.

thanks,
3,469
Posted By nxp
Illegal variable name!! This is the only message...
Illegal variable name!! This is the only message shows up...
3,469
Posted By nxp
Thanks! but it gives me an error, i.e Variable...
Thanks! but it gives me an error, i.e Variable syntax?!
3,469
Posted By nxp
removing files with certain number in the first row
Hello!

I have 32000 files in a directory and want to remove those with first row beging with 0.00; file names are in numbers from 1 through 32000; I have coded the following but it gives me...
3,153
Posted By nxp
Thank you so much! gawk works on Sun systems
Thank you so much! gawk works on Sun systems
3,153
Posted By nxp
Amazing result on Solaris!! But it does not work...
Amazing result on Solaris!! But it does not work on Sun, complaining nawk not found?! Any clue?
3,153
Posted By nxp
column data to rows every n line
Hi every one,

I am trying to organise an input text file like:


input
1 2 3 4 5
6 7 8
9 10
11 12 13 14 15
16 17 18
19 20

into an output as following:

output file

1 2 3 4 5...
6,982
Posted By nxp
Hi Scottn, I tried to change the code...
Hi Scottn,



I tried to change the code the get the desired outputs but it didnt happen. Assuming (NR-1%3+1), I'll bring a simple example to simplify what I am willing to have:





input...
6,982
Posted By nxp
well, (NR-1)%3+1 was just a test, the increments...
well, (NR-1)%3+1 was just a test, the increments between lines were actually 3325 in my actual input file, so i replace 3 with 3325! so i am dealing with sth like 33250 files in total, sonsidering 10...
6,982
Posted By nxp
Dear Scottn, Surprisingly, when i tried...
Dear Scottn,

Surprisingly, when i tried your first code on SUN, i.e.
awk '{print > "file" (NR-1)%3+1}' infile
it worked pretty well!! whereas when i tried the code with close (out) the outputs...
6,982
Posted By nxp
Dear Scottn, I switched to SUN systems and...
Dear Scottn,

I switched to SUN systems and the code 'kinda' worked. I mean, the numer of output files were correct but I had only one line in each output file. For the test case, I had one input...
6,982
Posted By nxp
Thanks!! well, the actual text file has 59850...
Thanks!!
well, the actual text file has 59850 records where I have to pick every 3325 records and output to different files!! So, i have to place some number around 18 which still gives me the same...
6,982
Posted By nxp
This works perfectly for limited number of files,...
This works perfectly for limited number of files, however if I am to deal with the entire data, actual case, there will be 2000 ouput files which the code gives me error, " too many output files",...
6,982
Posted By nxp
Thank you so much Scottn for your prompt reply. ...
Thank you so much Scottn for your prompt reply.
Is that supposed to creat 3 different files with the following formats:

The outputs

file1
1
2000
4000
6000

file2
2
2001
4001...
6,982
Posted By nxp
Every nth line with different starting point
Hi every one,

I am trying to generate different files from a column of numbers with the following format, as an example:


main file(input)
1 ...
Showing results 1 to 22 of 22

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