Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  • Users: erche
  • Order by date
  1. erche

    cut -d -f$list

    Hello, I have a problem with cut -d -f$list the requirements of "cut" command, the list have to be sorted increasing. but, somehow, i have a list which is have to look like this : 1,2,3,4,5,29,25,11,15,231,227,213,217,433,429,415, 419,635,631,617,621...
  2. erche

    asking command cut

    Hello, I have a problem with cut -d -f$list the requirements of "cut" command, the list have to be sorted increasing. but, somehow, i have a list which is have to look like this : 1,2,3,4,5,29,25,11,15,231,227,213,217,433,429,415,419,635...
  3. erche

    Split string into array not working

    Oh I see, so, for example, the a string is created like this : a=$(nawk 'BEGIN { printf(&quot;a,b,c&quot;); for (i=1;i<100;i+3) { printf(&quot;\n%d,%d,%d&quot;,i,i+1,i+2) } }') so, if i have that 'a' and and i put that a on : nawk '{ a=$(nawk 'BEGIN { printf(&quot;a,b,c&quot;); for...
  4. erche

    Split string into array not working

    Hi, Can someone advise me to correct this script : a=&quot;1,2,3,4,5,6,7,8&quot; nawk 'BEGIN { FS=&quot;,&quot; } { asum=split(a,b,FS) printf (&quot;%d&quot;,asum) } the result is asum = 0. it supposed to be returning 8. Please help Thanks
  5. erche

    Finding awk command to replace grep command

    Thanks PH, But something wrong happen when i tried to run your lines, this is the warning : nawk: trying to access field 619 input record number 1, file Paysf11.txt source line number 4 and to make things more clear. I still want to do like this : grep &quot;^[13];psf\/210;&quot; $filen |...
  6. erche

    Finding awk command to replace grep command

    Hello, I have this command on someone's script : grep &quot;^[13];psf\/210;&quot; $filen | cut -d&quot;;&quot; -f$List >> ${pathOut}/psf_210_${dateFile}.txt The 'List' created with awk : List=$(nawk 'BEGIN { printf(&quot;1,2,3,4,5&quot;); for(i=9; i<=2231; i+=202) {...
  7. erche

    Splitting a file...

    Nope, I'm not printing the i, Somehow I already found out what's wrong.. So, now I'm fixing it.
  8. erche

    Splitting a file...

    Hi Salem, Thanks for your reply, Yes, finally, after adding the end-brackets before do the splitting... it works. But, I have another problem, Why does the result always repeat ? If the input file have 7 line, then, the result will have 7 times which all the same. Example : abc1;1;2;3;4;5...
  9. erche

    Splitting a file...

    to be simple, here is a test script that i've made : nawk 'BEGIN { printf(&quot;1,2,3,4,5&quot;); split($0,a,&quot;;&quot;); for(i=9; i<=2231; i+=202) { printf(&quot;%d&quot;,a[i]); }}' Paysf.txt result : 1,2,3,4,500000000 Please help me with this.
  10. erche

    Splitting a file...

    Hi Salem, actually, the array are not from index 1. the whole script like this. for(i=9; i<=2231; i+=202) { split($0, a, &quot;;&quot;); if (a[1] == &quot;P1&quot;) { x1=a[i+2]; y1=a[i+6] } else if (a[1] == &quot;P2&quot;) { x2=a[i]; y2=a[i+2] }...
  11. erche

    Splitting a file...

    Still about split. This looks difference with the another split command which is usually used in awk, right ? as far as i know, with that split we can split a file according a separator and put them into an array. but somehow, i tried them and does not work well. I don't know if the split can...
  12. erche

    Interprete idea into awk syntax

    Hello Ygor, I already tried them, but still not working, this error still appear : stat@advcom:/s/i/Stat/testbed> ./testaw3.sh awk: record `3;a/210;7;abc1...' too long record number 1 actually, i had a script, another person made the script, and i just know the functional of the script...
  13. erche

    Interprete idea into awk syntax

    hi Ygor, I've tried your suggestions. It is worked. But, for a file with more columns, awk will output this error message : awk - argument too long.. so, it won't produce any output. this is the sample one line : 3;a;7;abc2;20030727050209;0;0;;4;3;1234;3;1000;3;X 2;3;X 3;3;X 4;3;X 5;3;X 6;3;X...
  14. erche

    Interprete idea into awk syntax

    Hi Ygor, Thanks for your reply... I hope you still can help me for further questions... what if, all of them are in one file, and they are separate by a keyword.. for example : abc1;20;90;77;88;99 abc2;22;93;71;68;89 abc2;31;60;21;87;74 abc1;32;76;55;13;93 abc2;39;96;57;83;27 ... ... How can...
  15. erche

    Interprete idea into awk syntax

    Hello, I have a simple question, hope that somebody would help. As i just browse a little about AWK, i don't really understand how to interprete my idea into AWK syntax. File1 A1;Input1;A3;A4;A5 20;90;77;88;99 33;80;81;67;54 32;76;55;13;93 .. .. .. File2 B1;Input2;B3;B4;B5 22;93;71;68;89...

Part and Inventory Search

Back
Top