Communities

Writing
Writing
Codidact Meta
Codidact Meta
The Great Outdoors
The Great Outdoors
Photography & Video
Photography & Video
Scientific Speculation
Scientific Speculation
Cooking
Cooking
Electrical Engineering
Electrical Engineering
Judaism
Judaism
Languages & Linguistics
Languages & Linguistics
Software Development
Software Development
Mathematics
Mathematics
Christianity
Christianity
Code Golf
Code Golf
Music
Music
Physics
Physics
Linux Systems
Linux Systems
Power Users
Power Users
Tabletop RPGs
Tabletop RPGs
Community Proposals
Community Proposals
tag:snake search within a tag
answers:0 unanswered questions
user:xxxx search by author id
score:0.5 posts with 0.5+ score
"snake oil" exact phrase
votes:4 posts with 4+ votes
created:<1w created < 1 week ago
post_type:xxxx type of post
Search help
Notifications
Mark all as read See all your notifications »

Activity for David‭

Type On... Excerpt Status Date
Edit Post #290322 Post edited:
clarify one point
11 months ago
Edit Post #290322 Initial revision 11 months ago
Answer A: How to extract string from file, run filter, and replace in file with new value?
Both replies, at different points, provided the basis for this working script. Assuming that the 12th line of file has something like: ```     HERE IS MY TITLE ``` where `HERE...` begins at column 8 (I need to omit the opening `` tag, as noted in the original post), then: ``` for file...
(more)
11 months ago
Comment Post #290287 I think I got it! This actually works (using your approach and structure): for filename in chapter-*.xhtml; do new12=$(sed -n '12p' "$filename" | cut -b 8- | se titlecase -n) sed -i -e '12s#^\(.*<p>\).*#'"\1$new12"'#g' "$filename" done (Hopefully that will show as "...
(more)
11 months ago
Comment Post #290287 Thanks for that - in this case (I think you'll see) the update was just to foreground something already in the existing question, not to alter it in any way. The existing answers still very much apply, and your `pup` suggestion already addressed it to some degree. Thanks for the answer, and for th...
(more)
11 months ago
Edit Post #290285 Post edited:
typo tweak
11 months ago
Edit Post #290285 Post edited:
add location of test data
11 months ago
Edit Post #290285 Post edited:
update with further clarification
11 months ago
Comment Post #290287 Thanks @#8049 - helpful! I see from your answer (and even more the other one) that I need to edit my original post to clarify one point. But there is a pending edit which I don't have rep to approve, and it's blocking me being able to edit my own post. Could you (as mod) approve, then I can update? T...
(more)
11 months ago
Edit Post #290285 Initial revision 11 months ago
Question How to extract string from file, run filter, and replace in file with new value?
TASK I am coding up ebooks to a specific standard, and have a script that converts a string into the correct titlecase for this publisher. When working with some public domain source files, one often gets this for a chapter title string: &emsp;&emsp;&emsp;`HERE IS MY TITLE` Using VSCodium (...
(more)
11 months ago