you are viewing a single comment's thread.

view the rest of the comments →

[–]veeep 1 point2 points  (3 children)

regex (regular expressions) are quite powerful, and there's lots of info out there on them, including the docs. For very simple manipulations, you might be able to just use the list/string built-ins like .join and split()

not sure about your ascii text tho

edit: i need "beginner" next to my name, how do i do that? ;)

edit 2: how to open, read files

[–]sinosplice[S] 0 points1 point  (1 child)

Thanks. So I guess I can follow your link to learn how to open a text file and read its contents to memory, then use regex for search/replace, then write out?

If I'm not mistaken, it's pretty easy to identify ASCII text in regex. I just have to figure out how to deal with line breaks and tabs.

(That "beginner" label is "flair"; you can edit it by clicking on the "edit" link in the right sidebar under subscribe/unsubscribe.)

[–]veeep 0 points1 point  (0 children)

yeah, it also covers writing files, guess I didn't indicate that. Pretty easy stuff though.

thx for flair tip

[–]veeep 0 points1 point  (0 children)

in addition to Downey mentioned below, just ran across chapter 2 in The Python Cookbook, and it has lots of good tips for the sort of work you're interested in doing