Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7186395
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T18:37:19+00:00 2026-05-28T18:37:19+00:00

I have this nifty little script that does a nice job of manipulating some

  • 0

I have this nifty little script that does a nice job of manipulating some data files for me…first it strips out unwanted data after the first semicolon, then it changes the data into a Unicode string, then removes any newline chars, and finally shuffles it into two mixed files (a and b) that I need to use.

It works beautifully with small files, but I’m now dealing with a file that’s so large that sed is hanging. Or perhaps that’s what’s happening…I don’t know exactly. Is there anyone out there who can offer a suggestion on how to (maybe?) buffer this or prevent it from hanging? (I’ve got 16GB ram and the file is…1707772 (k? I’m “ls -la”ing)…is that too large?) I’m seeing 100%cpu usage that’s never going away…only killing the process returns the window to usable.

Here’s the code:

#!/bin/bash
a="a";
b="b";
echo "Input Filename:";
read ifilename;
echo "Output Filename:";
read ofilename;
awk '{
    #dbg print "$0=" $0
    sub(/;.*$/, "")
    len=length($0)
    if (len == 4) {print "&#x0" $0 ";"}
    else if (len == 5) {print "&#x" $0 ";"}
    else {print "error in input: found len=" len " in XX" $0 "xx"}
}' /home/myhome/$ifilename > temp.txt;
cat temp.txt | tr -d "\n" > temp_nolfs.txt;
cat temp_nolfs.txt | sed -r 's/(.[^;]*;)/ \1 /g' | tr " " "\n" | shuf | tr -d "\n" > $ofilename$a".txt";
cat temp_nolfs.txt | sed -r 's/(.[^;]*;)/ \1 /g' | tr " " "\n" | shuf | tr -d "\n" > $ofilename$b".txt";
rm temp.txt;
rm temp_nolfs.txt;
echo "Done!";

Thanks for any and all suggestions!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T18:37:21+00:00Added an answer on May 28, 2026 at 6:37 pm

    Many thanks for the helpful suggestions; however, the issue wasn’t sed at all…I had been feeding it data with NO semicolon, which meant it was looking forever for something that didn’t exist. Worked fine, redundancies nonwithstanding, once I fed it properly structured data.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have some Scala code that does something nifty with two different versions of
I have some nifty javascript that serializes search input. the controller has this: @recipes
So I've got this UpdatePanel. Inside it I have a nifty little jQuery scroll
I have this nifty PAM module that validates each session (like a desktop session)
Here is some code I modified from this nifty site : http://jsfiddle.net/Ajhka/ I have
I've got this nifty little piece of code here that self-propogates ad infinitum every
I have come to the conclusion that the very nifty ASP.NET Dynamic Data framework
I found this nifty plugin that lets me create dashboard widgets from external files.
Have this self-made slider: http://jsfiddle.net/wyc3P/4/ What it does: takes min and max values in
I have this data AnsID QuesID AnsOrder ----------------------- 1 5 NULL 2 5 NULL

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.