0

I have gathered a wordlist for person to follow on twitter. However, there is a problem. When i cat and do xxd a extra hidden characters are found. i.e 1b5b 6d1b 5b4b . I need to strip those character. Lets say 007_sharky is name , when i cat it i get 00000000: 3030 375f 7368 6172 6b79 1b5b 6d1b 5b4b 007_sharky.[m.[K 00000010: 0a

But i need to get

00000000: 3030 375f 7368 6172 6b79 0a 007_sharky.

Its not for only one line for multiple line, so i can do

cat file | while read line; do
something 
done

I m missing the something part, how can i remove those character. Also i deleted the file mistakely again after formatting using cut awk and grep again i got this. Also the first pic is new one and second pic is old one. doneBash xxd image

https://gist.github.com/machinexa2/293823309ad804866b32b59eda17526d

10
  • 1
    Similar: Removing control chars (including console codes / colours) from script output Commented Jun 24, 2020 at 11:14
  • But i didnt understand what are they doing anyways hmm lot of sed scripts Commented Jun 24, 2020 at 11:17
  • 4
    Welcome to Unix & Linux! Please don't post images of text. Instead, paste the text directly into your question and use the formatting tools to format it as code. Commented Jun 24, 2020 at 11:20
  • Also, could you please edit your question and show us the output of head -n1 Twitter.Account | od -c? That might show the extra characters in a way that's easier for some of us to parse. Commented Jun 24, 2020 at 11:22
  • 4
    @DipeshSunrait please use them this time. Commented Jun 24, 2020 at 11:50

1 Answer 1

1

Looks like there are exactly 6 extra bytes at the beginning of each line. So you can use this:

cut -b 7- temp > result

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.