[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[ale] Perl or Python for editing files...
- Subject: [ale] Perl or Python for editing files...
- From: ale_nospam at fayettedigital.com (Jim Lynch)
- Date: Mon, 17 Oct 2011 14:17:11 -0400
- In-reply-to: <CAPfJb3pvh4t6Vi40hHH4=oTGW20s8kKqaTERWcb1dwc7Y8p-rg@mail.gmail.com>
- References: <CAPfJb3pvh4t6Vi40hHH4=oTGW20s8kKqaTERWcb1dwc7Y8p-rg@mail.gmail.com>
On 10/17/2011 02:01 PM, Chuck Payne wrote:
> Guys,
>
> I have four files I like to be able to edit from a script. I have
> heard that it's better to use Perl or Python to this than bash.
>
> I am new to be perl and python from a scripting. What would be easy? I
> know it question that would open up a larger debate, but I really need
> help on this.
>
> If you recommend one of the two can you show me a site that explain
> how to open and write the files.
>
>
> Thanks,
>
It really depends on the complexity of the edit task. A combination of
bash, sed and awk can do simple edits, driving ex with bash can do a bit
more complex operations, but perl or python would be best for really big
editing jobs. So to answer your question give us a real world example
of what you want to do. What's the input and the desired output?
Jim.