7

Вопрос по case, unicode-string, bash – Изменение первой буквы каждой строки в файле в верхний регистр

Error: User Rate Limit Exceeded

the bear ate the fish.
the river was too fast.

Станет:

The bear ate the fish.
The river was too fast.
  • The document contains some special letters: a, a, á, à, ǎ, ā, b, c, d, e, e, é, è, ě, ē, f, g, h, i, i, í, ì, ǐ, ī, j, k, l, m, n, o, o, ó, ò, ǒ, ō, p, q, r, s, t, u, u, ú, ù, ǔ, ü, ǘ, ǜ, ǚ, ǖ, ū, v, w, x, y, and z.
  • The uppercase forms of these letters are: A, A, Á, À, Ǎ, Ā, B, C, D, E, E, É, È, Ě, Ē, F, G, H, I, I, Í, Ì, Ǐ, Ī, J, K, L, M, N, O, O, Ó, Ò, Ǒ, Ō, P, Q, R, S, T, U, U, Ú, Ù, Ǔ, Ü, Ǘ, Ǜ, Ǚ, Ǖ, Ū, V, W, X, Y, and Z.

Error: User Rate Limit Exceeded

  • Error: User Rate Limit Exceeded

    от
  • Error: User Rate Limit Exceeded

    от
  • Error: User Rate Limit Exceeded

    от
  • Error: User Rate Limit Exceeded

    от
  • Error: User Rate Limit Exceeded

    от
  • Error: User Rate Limit Exceeded

    от
  • Error: User Rate Limit Exceeded

    от Sherwin Flight
  • Error: User Rate Limit Exceeded

    от The Nail
  • Error: User Rate Limit Exceeded

    от Village
  • Error: User Rate Limit Exceeded

    от pizza
  • Error: User Rate Limit Exceeded

    от Sherwin Flight
6 ответов
  • 6

    Code:

    pearl.311> cat file1
    linenumber11
    linenumber2  
    linenumber1
    linenumber4
    linenumber6
    pearl.312> awk '{print toupper(substr($0,1,1))""substr($0,2)}' file1
    Linenumber11
    Linenumber2  
    Linenumber1
    Linenumber4
    Linenumber6
    pearl.313> 
    

  • 2

    Error: User Rate Limit Exceeded sed -i -e 's/^\(.\)/\U\1/' file.txt

    Error: User Rate Limit Exceeded

    sed -i -e 's/^\(.\)/\U\1/' file.txt
    

  • 0

    Error: User Rate Limit Exceeded

    bash:

    while read x ; do echo "${x^*}" ; done < inputfile > outputfile
    

    done

    for f in a, a, á, à, ǎ, ā, b, c, d, e, e, é, è, ě, ē, f, g, h, i, i, í, ì, ǐ, ī, \
             j, k, l, m, n, o, o, ó, ò, ǒ, ō, p, q, r, s, t, \
             u, u, ú, ù, ǔ, ü, ǘ, ǜ, ǚ, ǖ, ū, v, w, x, y, and z.
    do  echo "$f foo bar." ; done | 
    while read x ; do echo "${x^*}" ; done | head -15 | tail -6
    

    E, foo bar.
    E, foo bar.
    É, foo bar.
    È, foo bar.
    Ě, foo bar.
    Ē, foo bar.
    

  • 6

    Error: User Rate Limit Exceeded sed 's/./\u&/'

    Error: User Rate Limit Exceededs/^\(.\)/\U\1/Error: User Rate Limit Exceeded\uError: User Rate Limit Exceeded

    sed 's/./\u&/'
    

    Error: User Rate Limit Exceeded

    sed 's/[[:alpha:]]/\u&/'
    

  • 1

    Error: User Rate Limit Exceeded

    function up { local c="$1" ; echo -e "$c" | tr '[a-z]' '[A-Z]' ; }
    while read line
    do
      echo $(up ${line:0:1})${line:1}
    done
    

  • 13

    Error: User Rate Limit Exceeded

    sed:

    sed  's/^\(.\)/\U\1/' yourfile > convertedfile
    

    the ^ represents the start of a line. . matches any character \U converts to uppercase \( ... \) specifies a section to be referenced later (as \1 in this case); parentheses are to be escaped here.

    not> yourfile