Re: gawk

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 05/16/2018 02:11 PM, Samuel Sieb wrote:
> On 05/16/2018 02:05 PM, Patrick Dupre wrote:
>> This is correct, but
>> if I do:
>>       print "#" > "tmptmp.txt" ;
>> after
>> print $1 $2 > "tmptmp.txt" ;
>>
>> then I get ^M
>> in my file
>> I do not have the ^M  if I only make print $1 $2 > "tmptmp.txt" ;
>> and never make a print "#"
>>
>> Can I avoid these ^M
>> ?
> 
> This really isn't the right place for this kind of question, but at
> least provide a full example of what you're trying to do.  You aren't
> providing enough info to get a useful response.

I agree with Sam that you aren't providing enough info. I think
you're saying you're essentially doing (in gawk):

	print $1 $2 > "tmptmp.txt";
	print "#" > "tmptmp.txt";

And ending up with a "^M" in your file. First off, the second line
would overwrite anything you did in the first line (you need to use a
">>" to APPEND data to an existing file...just like in the shell), and
the "^M" probably indicates a carriage return in the file. If you
changed the ORS (output record separator) to a carriage return from it's
default value of newline, that's what you'd get.

Patrick, this isn't the first time (or second or third) you've posted
a question with absolutely no context about what you're trying to do.
If you want help, you HAVE to tell us what you're trying to accomplish.
----------------------------------------------------------------------
- Rick Stevens, Systems Engineer, AllDigital    ricks@xxxxxxxxxxxxxx -
- AIM/Skype: therps2        ICQ: 22643734            Yahoo: origrps2 -
-                                                                    -
-    Admitting you have a problem is the first step toward getting   -
-    medicated for it.      -- Jim Evarts (http://www.TopFive.com)   -
----------------------------------------------------------------------
_______________________________________________
users mailing list -- users@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to users-leave@xxxxxxxxxxxxxxxxxxxxxxx



[Index of Archives]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [EPEL Devel]     [Fedora Magazine]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Desktop]     [Fedora Fonts]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Fedora Sparc]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux