Hi All,
I have the following code to parse a csv file. A

Sample line on the file is
SEC, 9/12/2004, 14:25:18, Security, 576, Success, P +rivilege Use, NT AUTHORITY\SYSTEM, GHOST01, Special privile +ges assigned to new logon:^` User Name: GHOST01$^` Domain: + US^` Logon ID: (0x0 0x15307D9E)^` Privileges: + SeBackupPrivilege^` SeRestorePrivilege^` SeD +ebugPrivilege^` SeChangeNotifyPrivilege
foreach $line (<INPUT>) { chomp($line); ($logtype, $date, $time, $type, $eventid, $status, $systemevent, $nt +auth, $hostname, $description) = split(",", $line); # So, $description becomes #Special privileges assigned to new logon:^` User Name: GHOST +01$^` Domain: US^` Logon ID: (0x0 0x15307D9E)^` + Privileges: SeBackupPrivilege^` SeRestorePrivilege +^` SeDebugPrivilege^` SeChangeNotifyPrivilege # I just need to get the User Name which is GHOST01$ out. if ($eventid==576) { ($desc, $username) = split("`", $description); ($logon, $uname) = split(":", $username); print $uname; } }
But I get GHOST01$^. How do I remove the ^ char at
the end? Any suggestions?

2004-12-10 Janitored by Arunbear - added code tags, as per Monastery guidelines


In reply to Parsing problem by meenac

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.