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 SkipVought 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: SP68
  • Order by date
  1. SP68

    Sed to insert string after second comma

    Hi, I have a text file that looks like this: abcbs,adbsd,,,,,, adsdfd,afdsf,,,,,, adfsd13,1232dfsfe,,,,,, And I want to insert a string after the second comma that looks like this: abcbs,adbsd,string,,,,, adsdfd,afdsf,string,,,,, adfsd13,1232dfsfe,string,,,,, Thanks, SP
  2. SP68

    Help adding newline

    Yes, it works but everything is printed it on the same line, which I don 't want it to be. I tried replace the print with printf /n and it did not work. Please advise SP
  3. SP68

    Help adding newline

    Thanks, it worked but it print everything on the same line. I would like the output looks like this: DN: user1,ou=testing,o=abc Changetype: modify Delete: l l: loca DN: user2,ou=testing,o=abc Changetype: modify Delete: l l" locb Thx, Steve
  4. SP68

    Help adding newline

    All, I need help adding newline using awk and this is what I have for the input file: DN: user1,ou=testing,o=abc Changetype: modify l: loca DN: user2,ou=testing,o=abc Changetype: modify l" locb I ran this command and it did not work. awk '{print}/^Changetype:/{print "Delete: l"'...
  5. SP68

    Help awk with print

    All, I have a text file looks similar below: DN: cn=user1,ou=admin,o=abc changetype: add l: loc1 HomeDirectory: FS1_vol0,ou=servers,o=abc DN: cn=user2,ou=is,o=abc l: loc2 messageserver: fs2 homedirectory: FS2_vol0,ou=servers,o=abc . . . I wanted to use awk to do this: DN: same as below...
  6. SP68

    Newbie with AWK - need help

    I got an error when I entered at the command prompt: awk -v RS=" '{gsub(/\n +/,"");$1=$1;print}' test.txt >testt.txt gawk: cmd. line:1: test.txt gawk: cmd. line:1: ^ syntax error
  7. SP68

    Newbie with AWK - need help

    It worked except I need to get rid of the space on certain lines. Example: Name: XXX Address: YYY City: ZZZ Name: AAA Address: BBB City: CCCC CC Name: AAA Address: BBB City: CCCCCC Thx, SP
  8. SP68

    Prevent wrap-around results with ldapsearch query

    I query the ldap server using the following command and noticed certain attributes that are longer than 80+ column end up wrap-around the next with a space indent. For example: ndshomedirectory: fs1_vol0,ou=servers,o=amc#0#users/test user1 Is there an option to prevent this or it is the...
  9. SP68

    Ldapsearch query home directory in eDirectory

    All, I tried to query the home directory in eDirectory and it did not work for me. Does anyone out did it with sucess? ldapsearch -h ldapserver -D cn=admin,o=amc -w password -b o=amc "(&(objectclass=user)(ndshomedirectory=fs1_vol0,ou=servers,o=amc))" dn ndshomedirectory Please advice, SP
  10. SP68

    Newbie with AWK - need help

    I had one issue with script if one or several entries in the input file looks like this: Name: XXX Address: yyy City: ZZZ Name: AAA Address: BBB City: CCC CCC Name: AAA Address: BBB City: CCC CCC How I modify this command awk ' /^Name:/{n=$0} /^Address:/{a=$0} /^City:/{printf "%s %s...
  11. SP68

    Newbie with AWK - need help

    I had one issue with script if one or several entries in the input file looks like this: Name: XXX Address: yyy City: ZZZ Name: AAA Address: BBB City: CCC CCC Name: AAA Address: BBB City: CCC CCC How I modify this command awk ' /^Name:/{n=$0} /^Address:/{a=$0} /^City:/{printf "%s %s...
  12. SP68

    Newbie with AWK - need help

    Thank you. You are very helpful. SP
  13. SP68

    Newbie with AWK - need help

    Oh, it is ":
  14. SP68

    Newbie with AWK - need help

    Is it column and row number? SP
  15. SP68

    Newbie with AWK - need help

    How do I reverse the format from Name: XXX Address: YYY City: ZZZ Name: AAA Address: BBB Citry: CCC to Name: XXX Address: yyy City: ZZZ Name: AAA Address: BBB City: CCC Thanks, SP
  16. SP68

    Newbie with AWK - need help

    Thanks. It worked after remove the single quote. SP
  17. SP68

    Newbie with AWK - need help

    I put the commands in the script file called awk.txt and type in awk -f awk.txt addr.txt and it error out. awk.txt contains: '/^Name:/{n=$0} /^Address:/{a=$0} /^City:/{printf "%s %s %s\n",n,a,$0;n=a=""}' Please advice Thanks, SP
  18. SP68

    Newbie with AWK - need help

    All, I am new with AWK and want to learn how to manipulate a text file. Here how the text file looks like before: Name: XXX Address: yyy City: ZZZ Name: AAA Address: BBB City: CCC And it is how it looks like after: Name: XXX Address: YYY City: ZZZ Name: AAA Address: BBB Citry: CCC...

Part and Inventory Search

Back
Top