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 strongm 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: *

  1. amkipnis

    Detect records with encoded characters in the file

    Thank you, Feherke. But, it does not change the name with either UTF-8 or utf8 option. Here is an entire list of supported encodings: 7bit-jis AdobeStandardEncoding AdobeSymbol AdobeZdingbat ascii ascii-ctrl big5-eten big5-hkscs cp1006 cp1026 cp1047 cp1250 cp1251 cp1252 cp1253 cp1254 cp1255...
  2. amkipnis

    Detect records with encoded characters in the file

    Hi Feherke, I appreciate your suggestion. I found utility called convmv. However, am not sure how to use it well. I tried the following command (based on man pages for convmv) but it did not update the file names. Being under the directory with encoded file names, I issued: convmv -f utf8 -t...
  3. amkipnis

    Detect records with encoded characters in the file

    Greetings, I have a datafile with records containing encoded characters (unknown format). I need to write a script which would find and move those records to another directory as well as subtitute those encoded characters with question marks. Here is what I wrote so far... For some reason, any...
  4. amkipnis

    Deleting XML block from the XML file

    Hi PHV, would you please provide me some guidance or at least starting point to the "awk" solution? Do I need to submit this question under "awk" forum? In any event, if I try the following command, the resulting file would list only unique lines, while I need to be able to retain whole 10-line...
  5. amkipnis

    Deleting XML block from the XML file

    Hi, I am trying to write the sed script which would exclude the 10-lines xml segment based on the given and found pattern. All 10-lines segments are indentically structured. Here is an example of the first 3 records of master XML file printers.conf: <Printer CL_010002> Info pa010002 DeviceURI...
  6. amkipnis

    Math operations in awk statement

    Hi futurelet. This code has been working great until now. Would please assist me in case I need almost a reverse to accomplish. Now, the report should display all values in Megabytes(MB) only, regardless the size computed in bytes, KB, MB, GB or TB. I appreciate your help. Thanks.
  7. amkipnis

    Using awk to parse off multiple records from the variable length file

    PHV, could you please assist me with another filtration. Would I exclude the "All" value in Roles: section by using your command with a minor modification: nawk ' $1=="Name:"{n=$2;print "ADDUSER "n} /Roles:/,/Groups:/{if($1!~":$" && $1!~"All")print "ADDUIG "$1" "n} '/path/to/input > output...
  8. amkipnis

    Using awk to parse off multiple records from the variable length file

    PHV, thank you very much. I got it working on my end. I had to use nawk, instead of awk. Otherwise, I was receiving an error: awk: syntax error near line 1 awk: illegal statement near line 1 Thanks again.
  9. amkipnis

    Using awk to parse off multiple records from the variable length file

    Greetings, could anyone please assist me with a following. I am trying to parse off and reconstruct the input file that would have a multiple sections separated by "-------------". I would like to extract two parts of each section. First is value of the records that starts with "Name:"...
  10. amkipnis

    Removing the Last Character in a String

    I need to remove a single quote as last character on each line in a string, but when I use this command I am getting a syntax error: sed 's/'$//g' infile > outfile For example, I need to change this ADDUSER HFA3343' to ADDUSER HFA3343 Could you please assist. Thanks.
  11. amkipnis

    Running script via cron job on last Sunday of each month.

    Thank you for a nice tip, John. This is very usefull solution.
  12. amkipnis

    Running script via cron job on last Sunday of each month.

    Igor, thank you very much. I have tested this code and it worked fine.
  13. amkipnis

    Running script via cron job on last Sunday of each month.

    Hello, I have a need to run a script on last Sunday of the month. What is the best approach for this task. Any help is appreciated. Thanks. Alex.
  14. amkipnis

    Math operations in awk statement

    Thank you PHV, it worked. Here is an original error message: awk: syntax error near line 1 awk: illegal statement near line 1
  15. amkipnis

    Math operations in awk statement

    Greetings, When I try to execute the following awk command I am extracting the third column (size value) from the file which is given in Bytes (by default). I am getting error while trying calculate total size for all file's records and displaing them in the readable range (Bytes, KB, MB, GB...
  16. amkipnis

    Extracting 7-8 bytes string from file with variable lenght records

    Thank you for your help, PHV. I have tried it and it worked great!
  17. amkipnis

    Extracting string from file with variable lenght records

    John, you gave me a clue that helped me to build the correct command: sed -n 's!.*/\(P......[0-9]*\).*!\1.txt!p' Thank you for your help!
  18. amkipnis

    Extracting 7-8 bytes string from file with variable lenght records

    Hello PHV, I have been using your solution for a while and it worked OK until I got to different problem. Here is a list: /Folder1/Next Directory/Operational/Pricing/Pricing Matrices/Next Directory/Pending/P0I5002_03-25-2004.roi /Folder1/Next Directory/Operational/Pricing/Pricing Matrices/Next...
  19. amkipnis

    Extracting string from file with variable lenght records

    I have been using your solution for a while until I got to different problem. Here is a list: /Folder1/Next Directory/Operational/Pricing/Pricing Matrices/Next Directory/Pending/P0I5002_03-25-2004.roi /Folder1/Next Directory/Operational/Pricing/Pricing Matrices/Next...
  20. amkipnis

    Extracting string from file with variable lenght records

    Thank you very much! It worked like a charm!

Part and Inventory Search

Back
Top