Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.
uneven matrix
Name: gpatel Date: November 17, 2005 at 05:44:01 Pacific OS: unix CPU/Ram: 1GB
Comment:
hey all, I have this file looks like this
A = [ 1 2 3 4 5 6 7 8 9 10 11 12 12 12 12 13 14 15 16 17 18 19 20 21 ] i wanted to get rid of 2nd row and 5th row. any row that doesnt have the same column as the previous one. my problem in matlab is it will take too long. since i have about 13000 rows and 46 coulmns. can someone help w/ unix script. thanks, Gpatel
Name: nails Date: November 17, 2005 at 08:13:27 Pacific
Reply:
So, I'm assuming that you need to NOT process 'A = [' in the first line and ' ]' in the last line?
If that's the case, these characters need to be retained?
0
Response Number 2
Name: gpatel Date: November 17, 2005 at 08:22:18 Pacific
Reply:
yes the file just look like this 1 2 3 4 5 6 7 8 9 10 11 12 12 12 12 13 14 15 16 17 18 19 20 21
there is no A and []; file only has numbers and some rows are different then others. i wanted to delete those rows which are different. thanks for your help nails. ~gpatel
thanks, Gaurav
0
Response Number 3
Name: gpatel Date: November 17, 2005 at 08:24:30 Pacific
Reply:
I meant to say differnt columns now rows.
thanks, Gaurav
0
Response Number 4
Name: nails Date: November 17, 2005 at 10:27:15 Pacific
Reply:
Here's my take: Read each line, determining the number of fields in each line. If the next line has the same number of lines, print it else if it doesn't delete it. When a line is deleted start the field count over:
awk ' BEGIN { cnt=0 } { if (cnt == 0) { pf=NF cnt++ print $0 continue }
Summary: hi, anyone knows how i can parameter a distant matrix printer connected via serial port under an ibm aix risc. it's not connected in local. thanks ...
Summary: Hi there I have a file containing a matrix of numbers with each column separated by a tab. It looks something like this: 10 5 10 10 5 10 10 10 5 5 5 5 10 10 5 10 (In actual fact the matrix at the mo...
Summary: I have a problem with a PCI TV Card: now I use a 375 driver that isn't so good, I watch a black matrix over my cursor, how can I repair it? Can you send me a better driver 4 my S3 86C375? Thank You!...