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 6715283
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T08:35:47+00:00 2026-05-26T08:35:47+00:00

I have lines like the ones shown below. abcbasndo bacmaisca ascmasoc Now, I need

  • 0

I have lines like the ones shown below.

abcbasndo
bacmaisca
ascmasoc

Now, I need to take out the first three characters of every line and add AAA at the start and end of each line, so that it looks like the one shown below.

AAAabcAAA
AAAbacAAA
AAAascAAA

I am using windows.

Please help.

  • 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-26T08:35:47+00:00Added an answer on May 26, 2026 at 8:35 am

    This little cmd script will do the job for you:

    @setlocal enableextensions enabledelayedexpansion
    @echo off
    for /f "delims=" %%a in (qq.txt) do (
        set var=%%a
        echo AAA!var:~0,3!AAA
    )
    endlocal
    

    See the following transcript:

    C:\Pax> type qq.txt
    abcbasndo
    bacmaisca
    ascmasoc
    
    C:\Pax> qq
    AAAabcAAA
    AAAbacAAA
    AAAascAAA
    

    The for loop grabs each line in the qq.txt file (without delims=, it would use spaces within the line as delimiters) and puts it in %%a.

    The body of the for loop puts that value into var and then uses the substring operator to get the first three characters.

    I haven’t tested what will happen if the line has less than three characters since (1) you didn’t specify what you expected; and (2) it should be fairly easy to expand this script to handle it.

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

Sidebar

Related Questions

I have a number of insert statements like the ones shown below that I
I have a tcp socket sending three lines like this out2.println(message1\n); out2.println(message2\n); out2.println(message3\n); and
When I paste lines, like the ones below, to Vim, " OmniCppComplete let OmniCpp_NamespaceSearch
I have received a project with many lines like the following ones: HtmlOutputText content
I have a lines like this NF419andZNF773 (e=10^-92,). ZNF571 (e=2 10^-14,) What's the regex
I have some text lines like that : vt_wildshade2^508^508 vt_ailleurs2^1188^1188 ... vt_high2^13652^13652 Is it
I have file with lines like so: 1 17 A G R:560:500:60:10.71%:1.6329E-19 Pass:1.0:276:0:57:0:1E0 15
I have a number of lines like if last_name: person.last_name = hashlib.sha512(last_name + salt).hexdigest()
I have a file with lines like account = TEST1 Qty=100 price = 20.11
I have lines in my js files like this console.log('FunctionName()'); The default Ajax Minifier

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.